package com.ease.web.struts2;

import java.io.IOException;
import java.io.OutputStream;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.dispatcher.StrutsResultSupport;

import com.ease.document.flyingsaucer.XhtmlRendererUtil;
import com.opensymphony.xwork2.ActionInvocation;

/**
 * 
 * @author nathanleewei
 * 
 */
public class XhtmlRendererResult extends StrutsResultSupport {

	/**
	 *
	 */
	private static final long serialVersionUID = -301919118006949480L;

	protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
		String documentString = null;
		XhtmlRendererUtil.process(getOutputStream(), documentString);

	}

	protected OutputStream getOutputStream() throws IOException {
		return ServletActionContext.getResponse().getOutputStream();
	}
}
